import { Controller } from "../../mvc/core/Controller";
import { IPlayerController } from "./interfaces/IPlayerController";
import { NetDispatcher } from "../../mvc/core/NetDispatcher";
import { ServerCommand } from "../mvc/ServerCommand";
import { RolePlayer } from "../scene/player/entity/RolePlayer";
import { PlayerEvent } from "../scene/events/PlayerEvent";
import { EGateCommand } from "../../../Message/Command/EGateCommand";
import { Dispatcher } from "../../mvc/core/Dispatcher";
import { EventName } from "../mvc/EventName";
import { EPublicCommand } from "../../../Message/Command/EPublicCommand";
import { DataEvent } from "../events/DataEvent";
import { GModuleEvent } from "../mvc/GModuleEvent";
import { AvatarUploadWindow } from "../view/player/AvatarUploadWindow";
import { MessageBlock } from "../../../Framework/MQ/MessageBlock";
import { SAttribute } from "../../../Message/Public/SAttribute";
import { AcupointData } from "../view/player/acupoint/AcupointData";
import { Cache } from "../cache/Cache";
import { SuitSkillWindow } from "../view/player/suitSkill/SuitSkillWindow";
import { AcupointHintIcon } from "../view/player/acupoint/AcupointHintIcon";
import { UiHintIconView } from "../view/uiIconBtn/UiHintIconView";
import { EffectManager } from "../manager/EffectManager";
import { UIIconEvent } from "../view/uiIconBtn/UIIconEvent";
import { SceneInfo } from "../scene/map/SceneInfo";
import { PulseSharedObject } from "../view/player/PulseSharedObject";
import { TodayNoTipsConst } from "../../component/gconst/TodayNoTipsConst";
import { HintIcon } from "../view/uiIconBtn/HintIcon";
import { ImagesConst } from "../resource/ImagesConst";
import { ItemData } from "../resource/info/ItemData";
import { TodayNotTipUtil } from "../../common/TodayNotTipUtil";
import { Language } from "../../../extend/language/Language";
import { Alert } from "../../../com/mui/controls/Alert";
import { ECategory } from "../../../Message/Public/ECategory";
import { GameProxy } from "../mvc/GameProxy";
import { MsgManager } from "../manager/MsgManager";
import { SOldPlayerCallBack } from "../../../Message/Game/SOldPlayerCallBack";
import { EBind } from "../../../Message/Public/EBind";
import { ItemsUtil } from "../view/shortcuts/item/ItemsUtil";
import { CustomAlertWin } from "../view/common/alertwins/CustomAlertWin";
import { ShopOperType } from "../view/shop/ShopOperType";
import { CursorManager } from "../manager/CursorManager";
import { EMountEquipType } from "../../../Message/Public/EMountEquipType";
import { EDressPos } from "../../../Message/Public/EDressPos";
import { EEquip } from "../../../Message/Public/EEquip";
import { IView } from "../../mvc/interfaces/IView";
import { PlayerModule } from "../../../modules/PlayerModule";
import { LadderBattlefieldUtil } from "../view/ladderBattlefield/LadderBattlefieldUtil";
import { SMapSuitSetPartsInfo } from "../../../Message/Public/SMapSuitSetPartsInfo";
import { EquipmentRepair } from "../view/player/repair/EquipmentRepair";
import { ECareer } from "../../../Message/Public/ECareer";
import { SAcupointInfo } from "../../../Message/Game/SAcupointInfo";
import { AcupointConfig } from "../resource/AcupointConfig";
import { SUpdateMsg } from "../../../Message/Game/SUpdateMsg";
import { ShopRule } from "../rules/ShopRule";
import { ENpcEffect } from "../../../Message/Public/ENpcEffect";
import { ShopConfig } from "../resource/ShopConfig";
import { GameController } from "../mvc/GameController";
import { FilterConst } from "../../component/gconst/FilterConst";
import { IPlayerModule } from "../../../modules/interfaces/IPlayerModule";
import { RenameModule } from "../../../modules/RenameModule";
import { SPlayerGuildInfo } from "../../../Message/Game/SPlayerGuildInfo";
import { SSuitLockInfo } from "../../../Message/Game/SSuitLockInfo";
import { SuitAttrLockWindow } from "../view/player/suitLock/SuitAttrLockWindow";
import { SSuitLockTip } from "../../../Message/Game/SSuitLockTip";
import { MsgTipInfo } from "../model/MsgTipInfo";
import { SuitLockTipView } from "../view/player/suitLock/SuitLockTipView";
import { SSuitSkillUpgradeRate } from "../../../Message/Game/SSuitSkillUpgradeRate";
import { SuitSkillRateTipPanel } from "../view/player/suitSkill/SuitSkillRateTipPanel";
import { SSuitSkillInfo } from "../../../Message/Game/SSuitSkillInfo";
import { SuitSkillMsgTip } from "../view/player/SuitSkillMsgTip";
import { SuitSkillTipPanel } from "../view/player/suitSkill/SuitSkillTipPanel";
type int = number;
//class PlayerController
    
    export  class PlayerController extends Controller implements IPlayerController
    {
        constructor()
        {
            
            super();NetDispatcher.addCmdListener(ServerCommand.RoleFightAttributeChange, this.updateAttributes);
            NetDispatcher.addCmdListener(ServerCommand.RoleFightAttributeBaseChange, this.updateAttributes);
            NetDispatcher.addCmdListener(ServerCommand.RolepackDataChange, this.rolepackDataChangeHandler);
            NetDispatcher.addCmdListener(ServerCommand.RolePackItemsChange, this.rolePackItemsChangeHandler);
            NetDispatcher.addCmdListener(ServerCommand.RoleExpUpdate, this.roleExpUpdateHandler);
            NetDispatcher.addCmdListener(ServerCommand.EntityInfo_Update, this.updateBaseAttributes);
            NetDispatcher.addCmdListener(ServerCommand.RoleCareerUpdate, this.onRoleCareerUpdateHandler);
            RolePlayer.instance.addEventListener(PlayerEvent.RoleLevelUpdate, this.onRoleLevelUpdateHandler);
            RolePlayer.instance.addEventListener(PlayerEvent.UpdateEquip, this.onUpdateEquipHandler);
            NetDispatcher.addCmdListener(ServerCommand.VIPInfoUpdateCommand, this.onVipInfoUpdateHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateAcupointInfo, this.onAcupointInfoReciveHandler);
            NetDispatcher.addCmdListener(ServerCommand.RoleNimbusChange, this.onNimbusChangeHandler);
            NetDispatcher.addCmdListener(ServerCommand.MoneyUpdate, this.onMoneyUpdateHandler);
            NetDispatcher.addCmdListener(ServerCommand.GangfightMeritCommand, this.onMeritChangeHandler);
            NetDispatcher.addCmdListener(ServerCommand.TitleCurrentTitleMaybeChange, this.onTilteUpdate);
            NetDispatcher.addCmdListener(ServerCommand.RoleFightCombatCapabilities, this.updateFight);
            NetDispatcher.addCmdListener(ServerCommand.RoleFightRuneFight, this.onRuneFightUpdateHandler);
            NetDispatcher.addCmdListener(ServerCommand.GuildUpdateInfo, this.onGuildUpdateInfoHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateSuitLockInfo, this.onSuitLockInfoHandler);
            NetDispatcher.addCmdListener(ServerCommand.MarryPlayerMarryUpdateCommand, this.onMarryUpdateHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateWorldLevel, this.onWorldLevelUpdate);
            NetDispatcher.addCmdListener(ServerCommand.RoleNewEnergyUpdate, this.onRoleNewEnergyUpdateHandler);
            NetDispatcher.addCmdListener(ServerCommand.AmuletHoleNumUpdateCommand, this.onAmuletHoleNumUpdateHandler);
            Dispatcher.addEventListener(EventName.RankGetMyToplistSuccess, this.onRankGetMyToplistSuccessHandler);
            Dispatcher.addEventListener(EventName.RoleAttributeCharmChange, this.onAttributeCharmChangeHandler);
            Dispatcher.addEventListener(EventName.ArenaMarkWeekChange, this.onArenaMarkWeekChangeHandler);
            Dispatcher.addEventListener(EventName.AcupointBeginUpgrade, this.onAcupointBeginUpgradeHandler);
            Dispatcher.addEventListener(EventName.AcupointUpgradeSuccess, this.onUpgradeSuccessHandler);
            Dispatcher.addEventListener(EventName.AcupointSpeedupUpgrade, this.onSpeedupUpgradeHandler);
            Dispatcher.addEventListener(EventName.AcupointReduceUpgradeTimeSuccess, this.onSpeedupUpgradeSuccessHandler);
            Dispatcher.addEventListener(EventName.AcupointHintIconClick, this.onHintIconClickHandler);
            Dispatcher.addEventListener(EventName.AcupointUpgradeRootSuccess, this.onUpgradeRootSuccessHandler);
            Dispatcher.addEventListener(EventName.AcupointUpgradeSavvySuccess, this.onUpgradeSavvySuccessHandler);
            Dispatcher.addEventListener(EventName.PlayerSetIsNotShowFashion, this.onSetIsNotShowFashionHandler);
            Dispatcher.addEventListener(EventName.PlayerSetIsNotShowWing, this.onSetIsNotShowWingHandler);
            Dispatcher.addEventListener(EventName.PlayerSetIsNotShowFashionWeapon, this.onSetIsNotShowFashionWeaponHandler);
            Dispatcher.addEventListener(EventName.PlayerSetIsNotShowFootPrint, this.onSetIsNotShowFootPrintHandler);
            Dispatcher.addEventListener(EventName.PlayerSetIsNotShowBubble, this.onSetIsNotShowBubbleHandler);
            Dispatcher.addEventListener(EventName.PlayerSetIsNotShowSurround, this.onSetIsNotShowSurroundHandler);
            Dispatcher.addEventListener(EventName.PlayerSetIsNotShowWaistBelt, this.onSetIsNotShowWaistBeltHandler);
            Dispatcher.addEventListener(EventName.PlayerSetIsNotShowElf, this.onSetIsNotShowElfHandler);
            Dispatcher.addEventListener(EventName.PlayerIsNotShowFashionWeapon, this.onIsNotShowFashionWeaponHandler);
            Dispatcher.addEventListener(EventName.PlayerIsNotShowFashion, this.onIsNotShowFashionHandler);
            Dispatcher.addEventListener(EventName.PlayerIsNotShowWing, this.onIsNotShowWingHandler);
            Dispatcher.addEventListener(EventName.PlayerIsNotShowFootPrint, this.onIsNotShowFootPrintHandler);
            Dispatcher.addEventListener(EventName.PlayerIsNotShowBubble, this.onIsNotShowBubbleHandler);
            Dispatcher.addEventListener(EventName.PlayerIsNotShowSurround, this.onIsNotShowSurroundHandler);
            Dispatcher.addEventListener(EventName.PlayerIsNotShowWaistBelt, this.onIsNotShowWaistBeltHandler);
            Dispatcher.addEventListener(EventName.PlayerIsNotShowElf, this.onIsNotShowElfHandler);
            Dispatcher.addEventListener(EventName.PlayerRootUpdateOpen, this.onRootUpdateOpenHandler);
            Dispatcher.addEventListener(EventName.AcupointHintIconHide, this.onHintIconHideHandler);
            Dispatcher.addEventListener(EventName.AcupointRootBreakThroughSuccess, this.onRootBreakThroughSuccessHandler);
            Dispatcher.addEventListener(EventName.AcupointRootBreakOpen, this.onRootBreakOpenHandler);
            Dispatcher.addEventListener(EventName.AcupointUpgradeSavvyExSuccess, this.onUpgradeSavvyExSuccessHandler);
            Dispatcher.addEventListener(EventName.PlayerRenamePropUsed, this.onPlayerRenamePropUsedHandler);
            Dispatcher.addEventListener(EventName.PlayerSureToRename, this.onPlayerSureToRenameHandler);
            Dispatcher.addEventListener(EventName.PlayerNameChange, this.onPlayerNameChangeHandler);
            Dispatcher.addEventListener(EventName.PlayerGuildNameChange, this.onPlayerGuildNameChangeHandler);
            Dispatcher.addEventListener(EventName.SexAttributeSexChange, this.onSexAttributeSexChangeHandler);
            Dispatcher.addEventListener(EventName.CampChangeSuccess, this.onCampChangeSuccessHandler);
            Dispatcher.addEventListener(EventName.PlayerModuleIndex, this.onPlayerModuleIndexHandler);
            Dispatcher.addEventListener(EventName.PlayerSuitLockOpen, this.onPlayerSuitLockOpenHandler);
            Dispatcher.addEventListener(EventName.LockSuit, this.onLockSuitHandler);
            Dispatcher.addEventListener(EventName.LockSuitGetCanLock, this.onLockSuitGetCanLockHandler);
            Dispatcher.addEventListener(EventName.LockSuitGetCanLockSuccess, this.onSuitGetCanLockSuccessHandler);
            NetDispatcher.addCmdListener(ServerCommand.SuitLockTipCommand, this.onSuitLockTipHandler);
            Dispatcher.addEventListener(EventName.PlayerSuitSkillOpen, this.onPlayerSuitSkillOpenHandler);
            Dispatcher.addEventListener(EventName.SuitSkillUpgrade, this.onSuitSkillUpgradeHandler);
            Dispatcher.addEventListener(EventName.SuitSkillUpgradeSuccess, this.oSuitSkillUpgradeSuccessHandler);
            Dispatcher.addEventListener(EventName.SuitSkillAddQi, this.onSuitSkillAddQiHandler);
            NetDispatcher.addCmdListener(ServerCommand.SuitSkillUpgradeRateCommand, this.onSuitSkillUpgradeRateCommandHandler);
            NetDispatcher.addCmdListener(ServerCommand.SuitSkillInfoCommand, this.onSuitSkillInfoCommandHandler);
            NetDispatcher.addCmdListener(ServerCommand.SuitSkillAccCommand, this.onSuitSkillAccCommandHandler);
            NetDispatcher.addCmdListener(ServerCommand.SuitSkillActiveCommand, this.onSuitSkillActiveCommandHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateRedGoldSuitActive, this.onSuitSkillRedGold);
            Dispatcher.addEventListener(EventName.PlayerModuleOperate, this.onModuleOperateHandler);
            Dispatcher.addEventListener(EventName.Guide_FragmentUseExchangeTab, this.onGuideFragmentExchangeTabHandler);
            Dispatcher.addEventListener(EventName.WardrobeDress, this.onDress);
            Dispatcher.addEventListener(EventName.WardrobeUndress, this.onUnDress);
            Dispatcher.addEventListener(EventName.Role_LookupRune, this.onLookupRuneHandler);
            Dispatcher.addEventListener(EventName.Role_AvatarUploadOpen, this.onAvatarUploadOpenHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateRootTargetBreakthrough, this.onRootTargetBreakthroughHandler);
            NetDispatcher.addCmdListener(ServerCommand.RoleMedalUpdate, this.onRoleMedalUpdateHandler);
            NetDispatcher.addCmdListener(ServerCommand.PlayerWuXingAttrUpdate, this.onWuXingAttrUpdataHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGatePlayerPhotoUpdate, this.onPlayerPhotoUpdateHandler);
            NetDispatcher.addCmdListener(ServerCommand.RoleCareerSecondUpdate, this.onRoleCareerSecondUpdate);
            NetDispatcher.addCmdListener(ServerCommand.RoleCareerEnableUpdate, this.onRoleCareerEnableUpdate);
            Dispatcher.addEventListener(EventName.FightSpiritUpdateBtnToolTips, this.onFightSpiritUpdateBtnToolTips);
            Dispatcher.addEventListener(EventName.FightSpiritOpenFlagChange, this.onFightSpiritOpenFlagChange);
            NetDispatcher.addCmdListener(ServerCommand.MyJewelTargetUpdate, this.onJewelTargetUpdate);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateSpiritEquipSuit, this.onSpiritEquipSuitHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateOldPlayerCallBackOffDay, this.isOldPlayerHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCanCallGuildHelp, this.GuildCallHelp);
            Dispatcher.addEventListener(EventName.Scene_Update, this.onSceneUpdate);
            return;
        }

        /* internal  */onGuideFragmentExchangeTabHandler(arg1: DataEvent): void
        {
            if (this.isModeSelfOpen()) 
            {
                if (this._playerModule.tabBarIdx != 3) 
                {
                    this._playerModule.guideFragmentExchangeTab();
                }
                else 
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PlayerTabBarChangeToExchange));
                }
            }
            return;
        }

        /* internal  */onLookupRuneHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as string;
            if (this._playerModule && this._playerModule.runeDescPanel.visible && loc1 == GModuleEvent.Mode_Self) 
            {
                this._playerModule.runeDescPanel.visible = false;
            }
            else if (this._playerModule && !this._playerModule.runeDescPanel.visible && loc1 == GModuleEvent.Mode_Self) 
            {
                this._playerModule.runeDescPanel.visible = true;
            }
            return;
        }

        /* internal  */onAvatarUploadOpenHandler(arg1: DataEvent): void
        {
            if (this._avatarUploadWindow == null) 
            {
                this._avatarUploadWindow = new AvatarUploadWindow();
            }
            this._avatarUploadWindow.show();
            return;
        }

        /* internal  */onRootTargetBreakthroughHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SAttribute;
            AcupointData.curRootTarget = loc1.value;
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateRootTarget();
            }
            return;
        }

        /* internal  */onRoleMedalUpdateHandler(arg1: Object): void
        {
            var loc1=arg1 as int;
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateMedal();
            }
            return;
        }

        /* internal  */onWuXingAttrUpdataHandler(arg1: Object): void
        {
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateWuXingFightInfo();
            }
            return;
        }

        /* internal  */onPlayerPhotoUpdateHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SAttribute;
            var loc2=loc1.value;
            Cache.instance.login.loginGame.player.photo = loc2;
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateUploadAvatar(loc2);
            }
            return;
        }

        /* internal  */onRoleCareerSecondUpdate(arg1: int): void
        {
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.enabledSecondCareer();
            }
            return;
        }

        /* internal  */onRoleCareerEnableUpdate(arg1: int): void
        {
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateEnableCareer(arg1);
            }
            return;
        }

        /* internal  */onJewelTargetUpdate(arg1): void
        {
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateAddInfos();
            }
            return;
        }

        public isModeSelfOpen(): Boolean
        {
            return this._playerModule && !this._playerModule.isHide && this._playerModule.mode == GModuleEvent.Mode_Self;
        }

        /* internal  */onFightSpiritUpdateBtnToolTips(arg1: DataEvent): void
        {
            var loc1=arg1.data as Array<any>;
            var loc2=cache.role.fightSpiritLevel;
            var loc3=cache.role.fightSpiritBreakLv;
            if (this.isModeSelfOpen()) 
            {
                this._playerModule.updateFightSpirit(loc1, loc2, loc3);
            }
            return;
        }

        /* internal  */onFightSpiritOpenFlagChange(arg1: DataEvent): void
        {
            if (this.isModeSelfOpen()) 
            {
                this._playerModule.showFightSpirit(cache.role.fightSpiritOpenFlag);
            }
            return;
        }

        /* internal  */onActiveSpiritEquipUpdate(arg1: int): void
        {
            if (!this._playerModule) 
            {
            };
            return;
        }

        /* internal  */onSpiritEquipEndFlagUpdate(arg1: int): void
        {
            if (!this._playerModule) 
            {
            };
            return;
        }

        public get suitSkillWindow(): SuitSkillWindow
        {
            return this._suitSkillWindow;
        }

        /* internal  */showHintIcon(): void
        {
            if (this._hintIcon == null) 
            {
                this._hintIcon = new AcupointHintIcon();
            }
            if (!this._hintIcon.parent) 
            {
                this._hintIcon.show();
                UiHintIconView.instance.addHintIcon(this._hintIcon);
            }
            return;
        }

        /* internal  */hideHintIcon(): void
        {
            if (this._hintIcon != null) 
            {
                if (this._hintIcon.parent) 
                {
                    this._hintIcon.parent.removeChild(this._hintIcon);
                    EffectManager.glowFilterUnReg(this._hintIcon);
                    this._hintIcon.dispatchEvent(new UIIconEvent(UIIconEvent.RemoveIcon));
                }
            }
            return;
        }

        /* internal  */onSceneUpdate(arg1: DataEvent): void
        {
            var loc1=arg1.data as SceneInfo;
            var loc2=[300102, 300103, 100102, 100103, 200102, 200103];
            if (loc2.indexOf(loc1.sMapDefine.mapId) == -1) 
            {
                this.hideGuildHelpIco();
            }
            return;
        }

        /* internal  */GuildCallHelp(arg1: MessageBlock): void
        {
            var loc1=PulseSharedObject.isTodayNotTips(TodayNoTipsConst.GuildCallHelp);
            if (!loc1) 
            {
                this.showGuildHelpIco();
            }
            return;
        }

        /* internal  */showGuildHelpIco(): void
        {
            if (!this._guildHelp) 
            {
                this._guildHelp = new HintIcon(ImagesConst.GuildCallHelpHintIco, false);
                this._guildHelp.addEventListener(flash.events.MouseEvent.CLICK, this.onClickGuildHelp);
            }
            if (!this._guildHelp.parent) 
            {
                UiHintIconView.instance.addHintIcon(this._guildHelp);
            }
            return;
        }

        /* internal  */hideGuildHelpIco(): void
        {
            if (this._guildHelp && this._guildHelp.parent) 
            {
                this._guildHelp.parent.removeChild(this._guildHelp);
                EffectManager.glowFilterUnReg(this._guildHelp);
                this._guildHelp.dispatchEvent(new UIIconEvent(UIIconEvent.RemoveIcon));
            }
            return;
        }

        protected onClickGuildHelp(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=new ItemData(14113400);
            TodayNotTipUtil.toDayNotTip(TodayNoTipsConst.GuildCallHelp, this.onCallHelpBack, Language.getStringByParam(380013, loc1.htmlName), null, Alert.OK | Alert.CANCEL, null, this.closeHelpTipHandler);
            return;
        }

        /* internal  */closeHelpTipHandler(arg1: int, arg2: Boolean): void
        {
            if (arg2) 
            {
                this.hideGuildHelpIco();
            }
            return;
        }

        /* internal  */onCallHelpBack(): void
        {
            var loc2=null;
            var loc1=this.cache.pack.backPackCache.getItemDataByType(ECategory._ECategoryProp, 113);
            if (loc1) 
            {
                GameProxy.packProxy.useItem(loc1.uid);
            }
            else 
            {
                loc2 = new ItemData(14113400);
                MsgManager.showRollTipsMsg(Language.getStringByParam(54174, loc2.name));
            }
            return;
        }

        /* internal  */isOldPlayerHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SOldPlayerCallBack;
            if (loc1.offDay > 0) 
            {
                cache.role.isOldPlayer = true;
            }
            else 
            {
                cache.role.isOldPlayer = false;
            }
            return;
        }

        /* internal  */onFightSpiritGuidePlayerBtn(arg1: DataEvent): void
        {
            view.show();
            if (this.isModeSelfOpen()) 
            {
                this._playerModule.guideFightSpirit();
            }
            return;
        }

        public dress(arg1: int, arg2: string, arg3: int=-1): void
        {
            var posType: int;
            var uid: string;
            var targetIndex: int=-1;
            var vItemData: ItemData;
            var vIndex: int;
            var clientTargetIndex: int;
            var htmlContent: string;
            var onClickHandler: Function;

            var loc1;
            vItemData = null;
            vIndex = 0;
            clientTargetIndex = 0;
            htmlContent = null;
            posType = arg1;
            uid = arg2;
            targetIndex = arg3;
            if (posType == 0) 
            {
                vIndex = Cache.instance.pack.backPackCache.getIndexByUid(uid);
            }
            vIndex = Cache.instance.pack.getPackChacheByPosType(posType).getIndexByUid(uid);
            vItemData = Cache.instance.pack.getPackChacheByPosType(posType).getItemDataByIndex(vIndex);
            if (targetIndex == -1) 
            {
                targetIndex = this.getIndex(vItemData, targetIndex);
            }
            if (targetIndex != -1) 
            {
                if (vItemData) 
                {
                    if (vItemData.itemExInfo && vItemData.itemExInfo.bind == EBind._EBindAfterUse) 
                    {
                        onClickHandler = (arg1: int): void
                        {
                            if (arg1 == Alert.OK) 
                            {
                                GameProxy.roleProxy.dress_async(vItemData, targetIndex, posType, vIndex);
                                Alert.resetToDefault();
                            }
                            return;
                        }
                        htmlContent = "<font color=\'#ffffff\'>" + Language.getString(30001) + "</font>";
                        if (ItemsUtil.isSpiritEquip(vItemData) && cache.pack.rolePackCache.isSameSpriteEquip(vItemData)) 
                        {
                            htmlContent = Language.getString(30339);
                        }
                        Alert.backgroundAlpha = 0;
                        Alert.alertWinRenderer = CustomAlertWin;
                        Alert.show(htmlContent, null, Alert.OK | Alert.CANCEL, null, onClickHandler);
                    }
                    else 
                    {
                        GameProxy.roleProxy.dress_async(vItemData, targetIndex, posType, vIndex);
                    }
                }
            }
            return;
        }

        public unDress(arg1: string): void
        {
            var loc1=Cache.instance.pack.rolePackCache.getIndexByUid(arg1);
            GameProxy.roleProxy.undress_async(arg1, loc1);
            return;
        }

        /* internal  */mouse_over(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (Cache.instance.shop.isOpening) 
            {
                var loc1=cache.shop.operType;
                switch (loc1) 
                {
                    case ShopOperType.FIX:
                    {
                        CursorManager.showCursor(CursorManager.FIX);
                        break;
                    }
                }
            }
            return;
        }

        /* internal  */mouse_out(arg1: Object /* flash.events.MouseEvent */): void
        {
            CursorManager.showCursor(CursorManager.NO_CURSOR);
            return;
        }

        /* internal  */getIndex(arg1: ItemData, arg2: int): int
        {
            var loc1=0;
            var loc2=0;
            if (arg1 && arg1.itemInfo && arg1.itemInfo.item) 
            {
                loc1 = arg1.itemInfo.item.type;
                loc2 = arg1.itemInfo.item.category;
            }
            if (arg2 == -1) 
            {
                if (loc2 != ECategory._ECategoryEquip) 
                {
                    if (loc2 != ECategory._ECategoryMount) 
                    {
                        if (loc2 != ECategory._ECategoryAmulet) 
                        {
                            if (loc2 != ECategory._ECategorySpiritEquip) 
                            {
                                if (loc2 == ECategory._ECategoryMountEquip) 
                                {
                                    if (loc1 != EMountEquipType._EMountEquipSaddle) 
                                    {
                                        if (loc1 != EMountEquipType._EMountEquipClothes) 
                                        {
                                            if (loc1 != EMountEquipType._EMountEquipStirrup) 
                                            {
                                                if (loc1 == EMountEquipType._EMountEquipRein) 
                                                {
                                                    arg2 = EDressPos._EDressMountEquipRein;
                                                }
                                            }
                                            else 
                                            {
                                                arg2 = EDressPos._EDressMountEquipStirrup;
                                            }
                                        }
                                        else 
                                        {
                                            arg2 = EDressPos._EDressMountEquipClothes;
                                        }
                                    }
                                    else 
                                    {
                                        arg2 = EDressPos._EDressMountEquipSaddle;
                                    }
                                }
                            }
                            else if (arg1) 
                            {
                                arg2 = arg1.effectEx;
                            }
                        }
                        else 
                        {
                            arg2 = cache.pack.rolePackCache.getTypeIndex(loc1);
                            if (arg2 == -1) 
                            {
                                arg2 = cache.pack.rolePackCache.getFirstSpaceMagicWeaponIndex();
                                if (arg2 == -1) 
                                {
                                    arg2 = EDressPos._EDressAmuletPosWeapon;
                                }
                            }
                        }
                    }
                    else 
                    {
                        arg2 = EDressPos._EDressPosMount;
                    }
                }
                else if (loc1 != EEquip._EEquipWeapon) 
                {
                    if (loc1 != EEquip._EEquipHelmet) 
                    {
                        if (loc1 != EEquip._EEquipShoulder) 
                        {
                            if (loc1 != EEquip._EEquipClothes) 
                            {
                                if (loc1 != EEquip._EEquipWristlet) 
                                {
                                    if (loc1 != EEquip._EEquipGloves) 
                                    {
                                        if (loc1 != EEquip._EEquipBelt) 
                                        {
                                            if (loc1 != EEquip._EEquipPants) 
                                            {
                                                if (loc1 != EEquip._EEquipShoes) 
                                                {
                                                    if (loc1 != EEquip._EEquipRing) 
                                                    {
                                                        if (loc1 != EEquip._EEquipJewelry) 
                                                        {
                                                            if (loc1 != EEquip._EEquipFashion) 
                                                            {
                                                                if (loc1 != EEquip._EEquipHeartLock) 
                                                                {
                                                                    if (loc1 != EEquip._EEquipWing) 
                                                                    {
                                                                        if (loc1 != EEquip._EEquipFashionWeapon) 
                                                                        {
                                                                            if (loc1 != EEquip._EEquipHarmMedalDeeper) 
                                                                            {
                                                                                if (loc1 != EEquip._EEquipHarmMedalLower) 
                                                                                {
                                                                                    if (loc1 != EEquip._EEquipFootPrint) 
                                                                                    {
                                                                                        if (loc1 != EEquip._EEquipBubble) 
                                                                                        {
                                                                                            if (loc1 != EEquip._EEquipSurround) 
                                                                                            {
                                                                                                if (loc1 != EEquip._EEquipWaistBelt) 
                                                                                                {
                                                                                                    if (loc1 == EEquip._EEquipElf) 
                                                                                                    {
                                                                                                        arg2 = EDressPos._EDressPosElf;
                                                                                                    }
                                                                                                }
                                                                                                else 
                                                                                                {
                                                                                                    arg2 = EDressPos._EDressPosWaistBelt;
                                                                                                }
                                                                                            }
                                                                                            else 
                                                                                            {
                                                                                                arg2 = EDressPos._EDressPosSurround;
                                                                                            }
                                                                                        }
                                                                                        else 
                                                                                        {
                                                                                            arg2 = EDressPos._EDressPosBubble;
                                                                                        }
                                                                                    }
                                                                                    else 
                                                                                    {
                                                                                        arg2 = EDressPos._EDressPosFootPrint;
                                                                                    }
                                                                                }
                                                                                else 
                                                                                {
                                                                                    arg2 = EDressPos._EDressPosHarmMedalLower;
                                                                                }
                                                                            }
                                                                            else 
                                                                            {
                                                                                arg2 = EDressPos._EDressPosHarmMedalDeeper;
                                                                            }
                                                                        }
                                                                        else 
                                                                        {
                                                                            arg2 = EDressPos._EDressPosFashionWeapon;
                                                                        }
                                                                    }
                                                                    else 
                                                                    {
                                                                        arg2 = EDressPos._EDressPosWing;
                                                                    }
                                                                }
                                                                else 
                                                                {
                                                                    arg2 = EDressPos._EDressPosHeartLock;
                                                                }
                                                            }
                                                            else 
                                                            {
                                                                arg2 = EDressPos._EDressPosFashion;
                                                            }
                                                        }
                                                        else if (Cache.instance.pack.rolePackCache.getItemDataByIndex(EDressPos._EDressPosJewelry1)) 
                                                        {
                                                            if (Cache.instance.pack.rolePackCache.getItemDataByIndex(EDressPos._EDressPosJewelry2)) 
                                                            {
                                                                if (this.lastJewelryChangeIndex != EDressPos._EDressPosJewelry1) 
                                                                {
                                                                    arg2 = EDressPos._EDressPosJewelry1;
                                                                    this.lastJewelryChangeIndex = arg2;
                                                                }
                                                                else 
                                                                {
                                                                    arg2 = EDressPos._EDressPosJewelry2;
                                                                    this.lastJewelryChangeIndex = arg2;
                                                                }
                                                            }
                                                            else 
                                                            {
                                                                arg2 = EDressPos._EDressPosJewelry2;
                                                                this.lastJewelryChangeIndex = arg2;
                                                            }
                                                        }
                                                        else 
                                                        {
                                                            arg2 = EDressPos._EDressPosJewelry1;
                                                            this.lastJewelryChangeIndex = arg2;
                                                        }
                                                    }
                                                    else if (Cache.instance.pack.rolePackCache.getItemDataByIndex(EDressPos._EDressPosRing1)) 
                                                    {
                                                        if (Cache.instance.pack.rolePackCache.getItemDataByIndex(EDressPos._EDressPosRing2)) 
                                                        {
                                                            if (this.lastRingChangeIndex != EDressPos._EDressPosRing1) 
                                                            {
                                                                arg2 = EDressPos._EDressPosRing1;
                                                                this.lastRingChangeIndex = arg2;
                                                            }
                                                            else 
                                                            {
                                                                arg2 = EDressPos._EDressPosRing2;
                                                                this.lastRingChangeIndex = arg2;
                                                            }
                                                        }
                                                        else 
                                                        {
                                                            arg2 = EDressPos._EDressPosRing2;
                                                            this.lastRingChangeIndex = arg2;
                                                        }
                                                    }
                                                    else 
                                                    {
                                                        arg2 = EDressPos._EDressPosRing1;
                                                        this.lastRingChangeIndex = arg2;
                                                    }
                                                }
                                                else 
                                                {
                                                    arg2 = EDressPos._EDressPosShoes;
                                                }
                                            }
                                            else 
                                            {
                                                arg2 = EDressPos._EDressPosPants;
                                            }
                                        }
                                        else 
                                        {
                                            arg2 = EDressPos._EDressPosBelt;
                                        }
                                    }
                                    else 
                                    {
                                        arg2 = EDressPos._EDressPosGloves;
                                    }
                                }
                                else 
                                {
                                    arg2 = EDressPos._EDressPosWristlet;
                                }
                            }
                            else 
                            {
                                arg2 = EDressPos._EDressPosClothes;
                            }
                        }
                        else 
                        {
                            arg2 = EDressPos._EDressPosShoulder;
                        }
                    }
                    else 
                    {
                        arg2 = EDressPos._EDressPosHelmet;
                    }
                }
                else 
                {
                    arg2 = EDressPos._EDressPosWeapon;
                }
            }
            return arg2;
        }

        protected /* override */ initView(): IView
        {
            if (this._playerModule == null) 
            {
                this._playerModule = new PlayerModule();
                this._playerModule.mode = GModuleEvent.Mode_Self;
                this._playerModule.addEventListener(flash.events.Event.ADDED_TO_STAGE, this.initOnAddToAtage);
                this._playerModule.addEventListener(GModuleEvent.Event_Dress, this.onDress);
                this._playerModule.addEventListener(GModuleEvent.Event_unDress, this.onUnDress);
                this._playerModule.addEventListener(flash.events.MouseEvent.MOUSE_OVER, this.mouse_over);
                this._playerModule.addEventListener(flash.events.MouseEvent.MOUSE_OUT, this.mouse_out);
            }
            return this._playerModule;
        }

        /* internal  */initOnAddToAtage(arg1: Object /* flash.events.Event */): void
        {
            this.updateBaseAttributes();
            this.roleExpUpdateHandler();
            this.updateAttributes();
            this.updateAllItems();
            this.updateFight(cache.role.combatCapabilities);
            this.onAmuletHoleNumUpdateHandler(Cache.instance.magicWeapon.holeNum);
            Dispatcher.dispatchEvent(new DataEvent(EventName.PlayerWindowShow));
            Dispatcher.dispatchEvent(new DataEvent(EventName.FahunOperView));
            return;
        }

        /* internal  */onDress(arg1: DataEvent): void
        {
            this.dress(arg1.data.posType, arg1.data.uid, arg1.data.index);
            return;
        }

        /* internal  */onUnDress(arg1: DataEvent): void
        {
            GameProxy.roleProxy.undress_async(arg1.data.uid, arg1.data.index);
            return;
        }

        /* internal  */updateFight(arg1: string): void
        {
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.setFighting(arg1);
            }
            return;
        }

        /* internal  */onRuneFightUpdateHandler(arg1: string): void
        {
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateRuneFight(arg1);
            }
            return;
        }

        /* internal  */updateAttributes(arg1: Object=null): void
        {
            var loc1=0;
            if (this._playerModule == null || this._playerModule.isHide) 
            {
                return;
            }
            if (Cache.instance.role.fightAttribute && Cache.instance.role.fightAttributeBase) 
            {
                loc1 = LadderBattlefieldUtil.isInLadderBattlefield ? cache.ladderBattlefield.ladderCareer : cache.role.careerEnabled;
                this._playerModule.updateAttr(Cache.instance.role.fightAttribute, Cache.instance.role.fightAttributeBase, loc1);
                this.updateHeadInfo();
            }
            return;
        }

        /* internal  */roleExpUpdateHandler(arg1: Object=null): void
        {
            if (this._playerModule == null || this._playerModule.isHide) 
            {
                return;
            }
            this._playerModule.setExperienceValue(cache.role.maxExp, cache.role.roleInfo.experience);
            return;
        }

        /* internal  */updateBaseAttributes(arg1: Object=null): void
        {
            if (this._playerModule == null || this._playerModule.isHide) 
            {
                return;
            }
            this._playerModule.setLifeValue(cache.role.entityInfo.maxLife, cache.role.entityInfo.life);
            this._playerModule.setMagicValue(cache.role.entityInfo.maxMana, cache.role.entityInfo.mana);
            this.updateHeadInfo();
            return;
        }

        /* internal  */updateHeadInfo(): void
        {
            var loc8=null;
            if (this._playerModule == null) 
            {
                return;
            }
            var loc1=cache.role.entityInfo.name;
            var loc2=cache.role.careerEnabled;
            var loc3=cache.role.entityInfo.level;
            var loc4=cache.role.entityInfo.camp;
            var loc5=cache.role.money.honour;
            var loc6=cache.role.playerInfo.sex;
            var loc7;
            if ((loc7 = Cache.instance.guild.myGuildInfo) == null) 
            {
                loc8 = Language.getString(30002);
            }
            else 
            {
                loc8 = loc7.guildName;
            }
            var loc9=cache.marry.playerMarry;
            this._playerModule.updateHeadInfo(loc1, loc2, loc3, loc4, loc5, loc8, loc6, loc9);
            return;
        }

        /* internal  */rolepackDataChangeHandler(arg1: Object=null): void
        {
            this.equipmentRepair.updateEquipment(cache.pack.rolePackCache.getAllItems());
            this.updateAllItems();
            return;
        }

        /* internal  */rolePackItemsChangeHandler(arg1: Object=null): void
        {
            this.equipmentRepair.updateEquipment(cache.pack.rolePackCache.getAllItems());
            this.updateAllItems();
            return;
        }

        /* internal  */updateAllItems(arg1: Object=null): void
        {
            if (this._playerModule == null || this._playerModule.isHide) 
            {
                return;
            }
            this._playerModule.setEquipments(cache.pack.rolePackCache.getAllItems(), cache.role.careerBasic, cache.pack.rolePackCache.getAllItemsSecondCareer(), cache.role.careerSecond);
            this._playerModule.updateFabaoData(cache.pack.rolePackCache.magicWeaponItems, cache.role.entityInfo.sex);
            return;
        }

        /* internal  */onSpiritEquipSuitHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SMapSuitSetPartsInfo;
            cache.spiritEquip.mapSuitSetPartsInfo = loc1;
            if (this._playerModule) 
            {
                this._playerModule.updateSpiritEquipSuit(loc1);
            }
            NetDispatcher.dispatchCmd(ServerCommand.SpiritEquipInfoUpdate, loc1);
            return;
        }

        public get equipmentRepair(): EquipmentRepair
        {
            if (!this._equipmentRepair) 
            {
                this._equipmentRepair = new EquipmentRepair();
            }
            return this._equipmentRepair;
        }

        /* internal  */onBeginUpgradeGrowthHandler(arg1: DataEvent): void
        {
            GameProxy.playerPulseProxy.startUpgradeGrowth();
            return;
        }

        /* internal  */onRoleCareerUpdateHandler(arg1: Object): void
        {
            var loc1=arg1 as int;
            if (cache.role.entityInfo.level >= 12 && !(loc1 == ECareer._ECareerNewPlayer) && !(loc1 == ECareer._ECareerNo) && AcupointData.leftTimes == 0) 
            {
                this.showHintIcon();
            }
            if (cache.role.entityInfo.level >= 10 && !(loc1 == ECareer._ECareerNewPlayer) && !(loc1 == ECareer._ECareerNo)) 
            {
                if (!(this._playerModule == null) && !this._playerModule.isHide) 
                {
                    this._playerModule.updateTitle();
                }
            }
            return;
        }

        /* internal  */onRoleLevelUpdateHandler(arg1: Object): void
        {
            if (this.isModeSelfOpen()) 
            {
                this._playerModule.checkTabBar();
            }
            var loc1=cache.role.entityInfo.level;
            var loc2=cache.role.entityInfo.career;
            if (loc1 == 12 && !(loc2 == ECareer._ECareerNewPlayer) && !(loc2 == ECareer._ECareerNo)) 
            {
                this.showHintIcon();
            }
            if (loc1 == 10 && !(loc2 == ECareer._ECareerNewPlayer) && !(loc2 == ECareer._ECareerNo)) 
            {
                if (this._playerModule != null) 
                {
                    this._playerModule.updateTitle();
                }
            }
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateNewEnergyInfo();
                this._playerModule.roleLevelUpdate();
            }
            return;
        }

        /* internal  */onRoleNewEnergyUpdateHandler(arg1: Object): void
        {
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateNewEnergyInfo();
            }
            return;
        }

        /* internal  */onAmuletHoleNumUpdateHandler(arg1: int): void
        {
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateFabaoHoleNum(arg1);
            }
            return;
        }

        /* internal  */onRankGetMyToplistSuccessHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Map<any, any> /* flash.utils.Dictionary */;
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateRankInfo(loc1);
            }
            return;
        }

        /* internal  */onAttributeCharmChangeHandler(arg1: DataEvent): void
        {
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.attributeCharmChange();
            }
            return;
        }

        /* internal  */onArenaMarkWeekChangeHandler(arg1: DataEvent): void
        {
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.arenaMarkWeekChange();
            }
            return;
        }

        /* internal  */onUpdateEquipHandler(arg1: Object): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateEquip();
            }
            return;
        }

        /* internal  */onVipInfoUpdateHandler(arg1: Object): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.vipInfoUpdate();
            }
            return;
        }

        /* internal  */onAcupointInfoReciveHandler(arg1: MessageBlock): void
        {
            var loc3=0;
            var loc4=0;
            var loc5=0;
            var loc6=0;
            var loc7=null;
            var loc1=arg1.messageBase as SAcupointInfo;
            AcupointData.setInfo(loc1);
            if (loc1.leftTime > 0) 
            {
                AcupointData.setSecTimer(loc1.leftTime);
            }
            if (this._playerModule != null) 
            {
                this._playerModule.updateCountdown();
                if (!this._playerModule.isHide) 
                {
                    this._playerModule.setAcupointInfo();
                }
            }
            var loc2=cache.role.entityInfo.careerEnable;
            if (cache.role.entityInfo.level >= 12 && !(loc2 == ECareer._ECareerNewPlayer) && !(loc2 == ECareer._ECareerNo)) 
            {
                loc3 = cache.role.roleInfo.nimbus;
                loc4 = cache.role.money.coin + cache.role.money.coinBind;
                loc5 = loc1.step;
                loc6 = AcupointData.getAcupointCurLevel(loc5, loc1);
                if ((loc7 = AcupointConfig.instance.getAcupointInfo(loc6, loc5)) == null) 
                {
                    return;
                }
                if (loc7.nimbus > loc3 || loc7.cost > loc4 || loc1.leftTime > 0) 
                {
                    return;
                }
                if (loc1.acupoint >= AcupointData.topLevel && loc1.step == 1) 
                {
                    return;
                }
                if (!(this._playerModule == null) && this._playerModule.isHide) 
                {
                    this.showHintIcon();
                }
                else if (this._playerModule == null && loc1.leftTime <= 0) 
                {
                    this.showHintIcon();
                }
            }
            return;
        }

        /* internal  */onWorldLevelUpdate(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SUpdateMsg;
            cache.role.curWorldLevel = loc1.value;
            cache.role.activeWorldLevel = parseInt(loc1.valueStr);
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateWorldLevel();
            }
            Dispatcher.dispatchEvent(new DataEvent(EventName.CurWorldLevelUpdate));
            return;
        }

        /* internal  */onAcupointBeginUpgradeHandler(arg1: DataEvent): void
        {
            GameProxy.acupoint.upgradeAcupoint();
            return;
        }

        /* internal  */onUpgradeSuccessHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as int;
            AcupointData.setSecTimer(loc1);
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateCountdown();
            }
            return;
        }

        /* internal  */onSpeedupUpgradeHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as int;
            GameProxy.acupoint.reduceUpgradeAcupoint(loc1);
            return;
        }

        /* internal  */onSpeedupUpgradeSuccessHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as int;
            AcupointData.setSecTimer(loc1);
            if (loc1 > 0 && !(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateCountdown();
            }
            return;
        }

        /* internal  */onHintIconClickHandler(arg1: DataEvent): void
        {
            view.show();
            this._playerModule.showAcupoint();
            return;
        }

        /* internal  */onNimbusChangeHandler(arg1: int): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateNimbus(arg1);
            }
            return;
        }

        /* internal  */onMoneyUpdateHandler(arg1: Object): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateMoney();
            }
            return;
        }

        /* internal  */onMeritChangeHandler(arg1: Object): void
        {
            this.guideMedal();
            return;
        }

        /* internal  */guideMedal(): void
        {
            var loc5=null;
            var loc6=null;
            var loc1=cache.role.money.merit;
            var loc2=ShopRule.getShopId(ENpcEffect._ENpcEffectMeritExchange);
            var loc3=ShopConfig.instance.getShopByName(loc2);
            var loc4=loc3.items;
            var loc7=0;
            while (loc7 < loc4.length) 
            {
                loc5 = loc4[loc7];
                if (loc1 >= loc5.tshopSell.price && cache.role.medalCode < loc5.tshopSell.itemCode) 
                {
                    loc6 = GameController.gameui.getGameui().getPlayersBtn();
                    EffectManager.glowFilterReg(loc6, [FilterConst.uiBtnFilter], 0.8, 10, 5, 10);
                    return;
                }
                ++loc7;
            }
            return;
        }

        /* internal  */onTilteUpdate(arg1: Object): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateTitle();
            }
            return;
        }

        /* internal  */onUpgradeRootSuccessHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data;
            var loc2=loc1.step;
            var loc3=loc1.newLevel;
            var loc4=loc1.effect;
            var loc5=loc1.acupointAttribute;
            AcupointData.setRootLevel(loc2, loc3);
            AcupointData.setRootEffects(loc2, loc4);
            AcupointData.setAttributesByStep(loc2, loc5);
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateAcupointInfo(loc2);
            }
            return;
        }

        /* internal  */onUpgradeSavvySuccessHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data;
            var loc2=loc1.leftTime as int;
            var loc3=loc1.step as int;
            var loc4=loc1.newLevel as int;
            AcupointData.setSavvyLevel(loc3, loc4);
            if (loc2 > 0) 
            {
                AcupointData.setSecTimer(loc2);
                this._playerModule.updateCountdown();
            }
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateAcupointInfo(loc3);
            }
            return;
        }

        /* internal  */onUpgradeSavvyExSuccessHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data;
            var loc2=loc1.step as int;
            var loc3=loc1.leftTime as int;
            var loc4=loc1.count as int;
            var loc5=loc1.newLevel as int;
            var loc6=loc1.result as Boolean;
            var loc7=loc1.rate as int;
            AcupointData.setSavvyLevel(loc2, loc5);
            if (loc3 > 0) 
            {
                AcupointData.setSecTimer(loc3);
                this._playerModule.updateCountdown();
            }
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateAcupointInfo(loc2);
            }
            return;
        }

        /* internal  */onSetIsNotShowFashionHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            GameProxy.roleProxy.notShowFashion(loc1);
            return;
        }

        /* internal  */onSetIsNotShowWingHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            GameProxy.roleProxy.notShowWing(loc1);
            return;
        }

        /* internal  */onSetIsNotShowFashionWeaponHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            GameProxy.roleProxy.notShowFashionWeapon(loc1);
            return;
        }

        /* internal  */onSetIsNotShowFootPrintHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            GameProxy.roleProxy.notShowFootprint(loc1);
            return;
        }

        /* internal  */onSetIsNotShowBubbleHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            GameProxy.roleProxy.notShowBubble(loc1);
            return;
        }

        /* internal  */onSetIsNotShowSurroundHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            GameProxy.roleProxy.notShowSurround(loc1);
            return;
        }

        /* internal  */onSetIsNotShowWaistBeltHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            GameProxy.roleProxy.notShowWaistBelt(loc1);
            return;
        }

        /* internal  */onSetIsNotShowElfHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            GameProxy.roleProxy.notShowElf(loc1);
            return;
        }

        /* internal  */onIsNotShowFashionHandler(arg1: DataEvent): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updataIsShowFashion();
            }
            return;
        }

        /* internal  */onIsNotShowWingHandler(arg1: DataEvent): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateIsShowWing();
            }
            return;
        }

        /* internal  */onIsNotShowFootPrintHandler(arg1: DataEvent): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateIsShowFootPrint();
            }
            return;
        }

        /* internal  */onIsNotShowBubbleHandler(arg1: DataEvent): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateIsShowBubble();
            }
            return;
        }

        /* internal  */onIsNotShowSurroundHandler(arg1: DataEvent): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateIsShowSurround();
            }
            return;
        }

        /* internal  */onIsNotShowWaistBeltHandler(arg1: DataEvent): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateIsShowWaistBelt();
            }
            return;
        }

        /* internal  */onIsNotShowElfHandler(arg1: DataEvent): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateIsShowElf();
            }
            return;
        }

        /* internal  */onIsNotShowFashionWeaponHandler(arg1: DataEvent): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateIsShowFashionWeapon();
            }
            return;
        }

        /* internal  */onRootUpdateOpenHandler(arg1: DataEvent): void
        {
            view.show();
            this._playerModule.showAcupoint(true);
            return;
        }

        /* internal  */onHintIconHideHandler(arg1: DataEvent): void
        {
            if (this._hintIcon && this._hintIcon.parent) 
            {
                this.hideHintIcon();
            }
            return;
        }

        /* internal  */onRootBreakThroughSuccessHandler(arg1: DataEvent): void
        {
            var e: DataEvent;
            var result: Boolean;
            var step: int;
            var rootName: string;
            var maxLevel: int;
            var tips: string;
            var onRootBreakTipsCloseHandler: Function;

            var loc1;
            step = 0;
            rootName = null;
            maxLevel = 0;
            tips = null;
            e = arg1;
            result = e.data["result"] as Boolean;
            step = e.data["step"] as int;
            if (this._playerModule && !this._playerModule.isHide && result) 
            {
                this._playerModule.updateRootBreak(step);
            }
            if (result) 
            {
                onRootBreakTipsCloseHandler = (arg1: int): void
                {
                    if (arg1 == Alert.OK) 
                    {
                        _playerModule.updateRootAfterBreakThrough(step);
                    }
                    return;
                }
                rootName = AcupointData.getAcupointName(step);
                maxLevel = AcupointData.getRootBreakThroughsLevelByStep(step);
                tips = "";
                tips = Language.getStringByParam(30256, rootName, maxLevel);
                Alert.show(tips, null, Alert.OK, null, onRootBreakTipsCloseHandler);
            }
            return;
        }

        /* internal  */onRootBreakOpenHandler(arg1: DataEvent): void
        {
            if (!AcupointData.isRootBreakThroughOpen()) 
            {
                return;
            }
            var loc1=1;
            view.show();
            (view as IPlayerModule).rootSavvyModule.show(430, 2);
            (view as IPlayerModule).changeTabBarByIndex(2);
            (view as IPlayerModule).rootSavvyModule.goToRootBreakThrough(loc1);
            return;
        }

        /* internal  */onPlayerRenamePropUsedHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data;
            var loc2=loc1.type;
            var loc3=loc1.itemData;
            if (this._renameModule == null) 
            {
                this._renameModule = new RenameModule();
            }
            this._renameModule.setRenameType(loc2, loc3);
            this._renameModule.show();
            return;
        }

        /* internal  */onPlayerSureToRenameHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Object;
            var loc2=loc1.nameStr as string;
            var loc3=loc1.propType as int;
            var loc4=loc1.itemData as ItemData;
            GameProxy.roleProxy.updatePlayerName(loc2, loc3, loc4.uid);
            return;
        }

        /* internal  */onPlayerNameChangeHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as string;
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.nameChange(loc1);
            }
            if (this._renameModule != null) 
            {
                this._renameModule.hide();
            }
            return;
        }

        /* internal  */onPlayerGuildNameChangeHandler(arg1: DataEvent): void
        {
            if (this._renameModule != null) 
            {
                this._renameModule.hide();
            }
            return;
        }

        /* internal  */onSexAttributeSexChangeHandler(arg1: DataEvent): void
        {
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateSexChange();
            }
            return;
        }

        /* internal  */onCampChangeSuccessHandler(arg1: DataEvent): void
        {
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateCampChange();
            }
            return;
        }

        /* internal  */onPlayerModuleIndexHandler(arg1: DataEvent): void
        {
            view.show();
            var loc1=int(arg1.data);
            (view as IPlayerModule).changeTabBarByIndex(loc1);
            return;
        }

        /* internal  */onGuildUpdateInfoHandler(arg1: Object): void
        {
            var loc1=null;
            if (arg1 != null) 
            {
                loc1 = arg1 as SPlayerGuildInfo;
            }
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateSelfGuildInfo(loc1);
            }
            return;
        }

        /* internal  */onSuitLockInfoHandler(arg1: MessageBlock): void
        {
            var msg: MessageBlock;
            var sSuitLockInfo: SSuitLockInfo;

            var loc1;
            msg = arg1;
            sSuitLockInfo = msg.messageBase as SSuitLockInfo;
            cache.role.suitLockedCodes = sSuitLockInfo.suitCodes;
            if (this._suitAttrLockWindow && this._suitAttrLockWindow.isHide == false) 
            {
                with ({}) 
                {
                };
                
#error('pushwith') {}
                .getSuitCanLock(
#error('pushwith') {}
                .getOk = (): void
                {
                    _suitAttrLockWindow.updateBySuitCode(cache.role.suitLockedCodes, cache.role.suitCanLockCodes);
                    return;
                })
            }
            Dispatcher.dispatchEvent(new DataEvent(EventName.PlayerSuitLockedChange));
            return;
        }

        /* internal  */onMarryUpdateHandler(arg1: Object): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.marryUpdate();
            }
            return;
        }

        public isInitView(): Boolean
        {
            return !(this._playerModule == null);
        }

        /* internal  */onPlayerSuitLockOpenHandler(arg1: DataEvent): void
        {
            var e: DataEvent;

            var loc1;
            e = arg1;
            if (this._suitAttrLockWindow == null) 
            {
                this._suitAttrLockWindow = new SuitAttrLockWindow();
            }
            with ({}) 
            {
            };
            
#error('pushwith') {}
            .getSuitCanLock(
#error('pushwith') {}
            .getOk = (): void
            {
                _suitAttrLockWindow.updateBySuitCode(cache.role.suitLockedCodes, cache.role.suitCanLockCodes);
                return;
            })
            this._suitAttrLockWindow.show();
            return;
        }

        /* internal  */onLockSuitHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data["suitCode"] as int;
            var loc2=arg1.data["doLock"] as Boolean;
            GameProxy.roleProxy.lockSuit(loc1, loc2);
            return;
        }

        /* internal  */onLockSuitGetCanLockHandler(arg1: DataEvent): void
        {
            GameProxy.roleProxy.getSuitCanLock();
            return;
        }

        /* internal  */onSuitGetCanLockSuccessHandler(arg1: DataEvent): void
        {
            if (!(this._playerModule == null) && !this._playerModule.isHide) 
            {
                this._playerModule.updateSuitPanel();
            }
            return;
        }

        /* internal  */onSuitLockTipHandler(arg1: SSuitLockTip): void
        {
            var loc1=new MsgTipInfo();
            if (this._suitLockTipView == null) 
            {
                this._suitLockTipView = new SuitLockTipView();
            }
            this._suitLockTipView.udpateBySuitLockTip(arg1);
            loc1.displayObject = this._suitLockTipView;
            loc1.type = 1;
            Dispatcher.dispatchEvent(new DataEvent(EventName.MsgTipDateChange, loc1));
            return;
        }

        /* internal  */onPlayerSuitSkillOpenHandler(arg1: DataEvent): void
        {
            var loc1=cache.role.suitSkillInfo;
            if (loc1 && !(loc1.skillId == 0)) 
            {
                if (this._suitSkillWindow == null) 
                {
                    this._suitSkillWindow = new SuitSkillWindow();
                }
                this._suitSkillWindow.show();
            }
            return;
        }

        /* internal  */onSuitSkillUpgradeHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as int;
            GameProxy.roleProxy.upgradeSuitSkill(loc1);
            return;
        }

        /* internal  */oSuitSkillUpgradeSuccessHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            if (loc1) 
            {
                MsgManager.showRollTipsMsg(Language.getString(35985));
            }
            else 
            {
                MsgManager.showRollTipsMsg(Language.getString(35986));
            }
            return;
        }

        /* internal  */onSuitSkillAddQiHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data["posType"] as int;
            var loc2=arg1.data["items"] as Map<any, any> /* flash.utils.Dictionary */;
            GameProxy.roleProxy.addAccumulation(loc1, loc2);
            return;
        }

        /* internal  */onSuitSkillUpgradeRateCommandHandler(arg1: SSuitSkillUpgradeRate): void
        {
            var loc1=null;
            if (this._suitSkillWindow && this._suitSkillWindow.isHide == false) 
            {
                this._suitSkillWindow.updateBySkillRate(arg1);
            }
            if (!this._hasShowSuitSkillRateTipPanel && cache.role.isSuitSkillRateAlert()) 
            {
                if (!this._suitSkillRateTipPanel) 
                {
                    this._suitSkillRateTipPanel = new SuitSkillRateTipPanel();
                }
                this._hasShowSuitSkillRateTipPanel = true;
                loc1 = new MsgTipInfo();
                loc1.type = 1;
                loc1.isAutoHide = false;
                loc1.displayObject = this._suitSkillRateTipPanel;
                Dispatcher.dispatchEvent(new DataEvent(EventName.MsgTipDateChange, loc1));
            }
            if (this._playerModule && !this._playerModule.isHide) 
            {
                this._playerModule.updateSuitSkillRate();
            }
            return;
        }

        /* internal  */onSuitSkillInfoCommandHandler(arg1: SSuitSkillInfo): void
        {
            var loc1=null;
            if (this._suitSkillWindow && this._suitSkillWindow.isHide == false) 
            {
                this._suitSkillWindow.updateBySuitSkillInfo(arg1);
            }
            if (cache.role.suitSkillInfo && cache.role.suitSkillInfo.skillId > 0 && cache.role.suitSkillInfo.level == 0) 
            {
                if (this._suitSkillMsgTip == null) 
                {
                    this._suitSkillMsgTip = new SuitSkillMsgTip();
                    this._suitSkillMsgTip.addEventListener(flash.events.MouseEvent.CLICK, this.onSuitSkillMsgTipClickHandler);
                }
                this._suitSkillMsgTip.updateTips();
                loc1 = new MsgTipInfo();
                loc1.type = 1;
                loc1.isAutoHide = true;
                loc1.displayObject = this._suitSkillMsgTip;
                Dispatcher.dispatchEvent(new DataEvent(EventName.MsgTipDateChange, loc1));
            }
            if (arg1 && arg1.skillId == 0 && arg1.level == 0) 
            {
                if (this._suitSkillWindow) 
                {
                    this._suitSkillWindow.hide();
                }
            }
            return;
        }

        /* internal  */onSuitSkillMsgTipClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            view.show();
            Dispatcher.dispatchEvent(new DataEvent(EventName.MsgTipWindowHide));
            return;
        }

        /* internal  */onSuitSkillAccCommandHandler(arg1: int): void
        {
            if (this._suitSkillWindow && this._suitSkillWindow.isHide == false) 
            {
                this._suitSkillWindow.updateAccumulation(arg1);
            }
            return;
        }

        /* internal  */onSuitSkillActiveCommandHandler(arg1: Object): void
        {
            var loc1=new MsgTipInfo();
            if (this._suitSkillTipPanel == null) 
            {
                this._suitSkillTipPanel = new SuitSkillTipPanel();
            }
            this._suitSkillTipPanel.updateTips("Red");
            loc1.displayObject = this._suitSkillTipPanel;
            loc1.type = 1;
            Dispatcher.dispatchEvent(new DataEvent(EventName.MsgTipDateChange, loc1));
            return;
        }

        /* internal  */onSuitSkillRedGold(arg1: MessageBlock): void
        {
            var loc1=new MsgTipInfo();
            if (this._suitSkillTipPanel == null) 
            {
                this._suitSkillTipPanel = new SuitSkillTipPanel();
            }
            this._suitSkillTipPanel.updateTips("RedGold");
            loc1.displayObject = this._suitSkillTipPanel;
            loc1.type = 1;
            Dispatcher.dispatchEvent(new DataEvent(EventName.MsgTipDateChange, loc1));
            return;
        }

        /* internal  */onModuleOperateHandler(arg1: DataEvent): void
        {
            view.hide();
            return;
        }

        public /* const */posType: int=3;

        private /* var */_playerModule: IPlayerModule;

        private /* var */lastRingChangeIndex: int;

        private /* var */lastJewelryChangeIndex: int;

        private /* var */lastCLientRingChangeIndex: int;

        private /* var */lastClientJewelryChangeIndex: int;

        private /* var */_hintIcon: AcupointHintIcon;

        private /* var */_guildHelp: HintIcon;

        private /* var */_login: Boolean=false;

        private /* var */_suitAttrLockWindow: SuitAttrLockWindow;

        private /* var */_suitSkillWindow: SuitSkillWindow;

        private /* var */_suitLockTipView: SuitLockTipView;

        private /* var */_suitSkillTipPanel: SuitSkillTipPanel;

        private /* var */_suitSkillRateTipPanel: SuitSkillRateTipPanel;

        private /* var */_hasShowSuitSkillRateTipPanel: Boolean;

        private /* var */_equipmentRepair: EquipmentRepair;

        private /* var */_avatarUploadWindow: AvatarUploadWindow;

        private /* var */_renameModule: RenameModule;

        private /* var */_suitSkillMsgTip: SuitSkillMsgTip;
    }
